#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e3+5;
set<int> s;
int val[N];
signed main(){
	freopen("kte.in","r",stdin);
	freopen("kte.out","w",stdout);
	int n;cin>>n;
	for(int i=1;i<=n;i++){
		int x;cin>>x;
		if(s.find(x)!=s.end()) s.erase(x);
		else s.insert(x);
		int cnt=0;
		for(auto x:s){
			val[++cnt]=x;
		}
		int l=1,r=cnt,s1=0,s2=0;
		vector<pair<int,int>> seg;
		for(int i=1;i<=cnt;i++){
			s1+=val[l],s2+=val[r];
			l++,r--;
			seg.push_back(make_pair(s1,s2-1));
		}
		sort(seg.begin(),seg.end());
		int lst=0,ans=0;
		for(auto s:seg){
			if(s.first>lst){
				ans+=s.second-s.first+1,lst=s.second;
			}
			else{
				ans+=max(s.second-lst,0ll);
				lst=max(lst,s.second);
			}
		}
		cout<<ans<<"\n";
	}
}
